package thread;

/**
 * @Author fallrain
 * @Description 继承Thread类，重写run方法
 * @Date 2022/2/10 17:47
 * @Version 1.0
 */
public class InheritThread extends Thread{

    @Override
    public void run(){
        //编写自己的线程
        System.out.println(Thread.currentThread().getName());
    }

    public static void main(String[] args) {
        InheritThread inheritThread = new InheritThread();
        inheritThread.setName("我自己定义的线程1");
        inheritThread.start();
        System.out.println(Thread.currentThread().toString());
    }
}
